<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>天狗商场--商品列表</title>
    <!-- 引入样式文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.12/lib/index.css" />

    <!-- 引入 Vue 和 Vant 的 JS 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vant@2.12/lib/vant.min.js"></script>

    <style>
        #main {
            margin: 20px 10px 60px 10px;
        }

        .my-swipe .van-swipe-item {
            color: #fff;
            font-size: 20px;
            line-height: 150px;
            text-align: center;
            background-color: #39a9ed;
        }
    </style>
</head>

<body>
<div id="app">

    <!-- 顶部导航 -->
    <van-nav-bar title="天狗商城" left-text="返回" left-arrow>
        <template #right>
            <van-icon name="search" size="18"></van-icon>
        </template>
    </van-nav-bar>

    <h1>树洞</h1>
    <div id="app">
        <van-tabbar v-model="active" inactive-color="#1989fa"  active-color="#ee0a24" @change="onChange">
            <van-tabbar-item icon="home-o" >主页</van-tabbar-item>
            <van-tabbar-item icon="smile-o"  dot>树洞</van-tabbar-item>
            <van-tabbar-item icon="more-o"  badge="5">消息</van-tabbar-item>
            <van-tabbar-item icon="friends-o">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</div>
<script>
    function goToPage(index){
        let page = "index.html" ;
        switch(index) {
            case 0:
                page = "index.html"  ;
                break ;
            case 1:
                page = "shudong.html"  ;
                break ;
            case 2:
                page = "news.html"  ;
                break ;
            case 3:
                page = "my.html"  ;
                break ;
        }
        location.href = page ;
    }
    let vm = new Vue({
        el: '#app',
        data: {
            value: '',
            active: 1,
        },
        methods: {
            onChange( index ) {
                goToPage(index) ;
            }
        },
        mounted() {

        }
    });
</script>
</body>

</html>